package com.lyt.dao;

import com.lyt.bean.TestStatus;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.sql.Date;

/**
 * @Author:张勇
 * @Date：2023/5/11 22:36
 * @Info:
 */
@Repository
public interface TestStatusDao {

    @Insert("insert into test_status values(#{stuTestId},#{studentId},#{name},#{getData},#{submitData},#{cutNum},#{isHandPaper})")
    public void addTestStatus(TestStatus testStatus);

    @Select("select student_id from test_status where student_id = #{0}")
    public Integer selStuByStuId(Integer id);

    @Select("select cutNum from test_status where student_id = #{0}")
    public Integer selStuCutNumByStuId(Integer id);

    @Update("update test_status set cutNum = #{num} where student_id = #{id}")
    public void updateCutNum(Integer id,Integer num);


    @Select("select isHandPaper from test_status where student_id = #{id}")
    public Integer selStuHandPaperByStuId(Integer id);

    @Update("update test_status set isHandPaper = #{num} where student_id = #{id}")
    public void updateHandPaper(Integer id,Integer num);

    @Select("select * from test_status where student_id = #{id}")
    public TestStatus selSubmitPaperTime(Integer id);

    @Update("update test_status set submitData = #{data} where student_id = #{id}")
    public void updateSubmitPaperTime(Integer id, long data);
}
